package com.wl.cloud.common.annotation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.List;

/**
 * @author: wanglin
 * @date: 2023-09-01 周五
 * @Version: 1.0
 * @Description:
 */
public class IsNotBlankListByKeyValidator implements ConstraintValidator<NotBlankListByKey, List<?>> {
    @Override
    public void initialize(NotBlankListByKey constraintAnnotation) {
        ConstraintValidator.super.initialize(constraintAnnotation);
    }

    @Override
    public boolean isValid(List<?> objects, ConstraintValidatorContext context) {
        boolean isBlankFlag = ValidatorUtil.isEmptyInList(objects);
        return !isBlankFlag;
    }
}
